﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Usermanagment.VisualDisplay
{
	using Usermanagment.DBConnection;
	public partial class MainMenu : Form
	{
		private DBConnect dbc;
		private Createscreen cs;
		private UserUpdate uu;
		private Tabledata td;
		public MainMenu()
		{
			InitializeComponent();
			this.MaximumSize = this.MinimumSize = this.Size;
		}

		public MainMenu(DBConnect dbc)
			: this()
		{
			this.dbc = dbc;
		}

		private void sTable_Click(object sender, EventArgs e)
		{
			if(td == null || td.IsDisposed)
				td = new Tabledata(dbc);
			if(!td.Visible)
				td.Visible = true;
		}

		private void cUser_Click(object sender, EventArgs e)
		{
			if(cs == null || cs.IsDisposed)
				cs = new Createscreen(dbc);
			if(!cs.Visible)
				cs.Visible = true;
		}

		private void btnUUsr_Click(object sender, EventArgs e)
		{
			if(uu == null || uu.IsDisposed)
				uu = new UserUpdate(dbc);
			if(!uu.Visible)
				uu.Visible = true;
		}

		
		
	}
}
